package data.model;

import org.apache.commons.collections.MapUtils;

import java.util.HashMap;
import java.util.Map;

public class BasePlayer {

    protected long playerId;
    protected String nickName;
    protected String headUrl;
    protected Integer playerSex = 0;
    protected Integer vipLevel = -1;
    protected String presentation;
    protected Map<PropType, Long> bagInfo = new HashMap<>();

    public BasePlayer(long playerId, String nickName, String headUrl, int playerSex, String presentation, int vipLevel) {
        this.playerId = playerId;
        this.nickName = nickName;
        this.headUrl = headUrl;
        this.playerSex = playerSex;
        this.vipLevel = vipLevel;
        this.presentation = presentation;
        this.bagInfo = bagInfo;
    }

    public BasePlayer(long playerId, String nickName) {
        this.playerId = playerId;
        this.nickName = nickName;
    }

    public long getMondey(PropType type) {
        return MapUtils.getLongValue(bagInfo, type);
    }

    public long getPlayerId() {
        return playerId;
    }

    public void setPlayerId(long playerId) {
        this.playerId = playerId;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getHeadUrl() {
        return headUrl;
    }

    public void setHeadUrl(String headUrl) {
        this.headUrl = headUrl;
    }

    public Integer getPlayerSex() {
        return playerSex;
    }

    public void setPlayerSex(Integer playerSex) {
        this.playerSex = playerSex;
    }

    public Integer getVipLevel() {
        return vipLevel;
    }

    public void setVipLevel(Integer vipLevel) {
        this.vipLevel = vipLevel;
    }

    public String getPresentation() {
        return presentation;
    }

    public void setPresentation(String presentation) {
        this.presentation = presentation;
    }

    public Map<PropType, Long> getBagInfo() {
        return bagInfo;
    }

    public void setBagInfo(Map<PropType, Long> bagInfo) {
        this.bagInfo = bagInfo;
    }

}
